import { defineUniPages } from '@uni-helper/vite-plugin-uni-pages'

export default defineUniPages({
  globalStyle: {
    navigationStyle: 'default',
    navigationBarTitleText: 'unibest',
    navigationBarBackgroundColor: '#f8f8f8',
    navigationBarTextStyle: 'black',
    backgroundColor: '#FFFFFF',
    // 添加全局下拉刷新配置
    enablePullDownRefresh: false,
    onReachBottomDistance: 50
  },
  easycom: {
    autoscan: true,
    custom: {
      '^wd-(.*)': 'wot-design-uni/components/wd-$1/wd-$1.vue',
      '^(?!z-paging-refresh|z-paging-load-more)z-paging(.*)':
        'z-paging/components/z-paging$1/z-paging$1.vue',
    },
  },
  // 页面配置（确保登录页是第一项）
  pages: [
    {
      path: 'pages/Login/index',
      style: {
        navigationBarTitleText: '',
        navigationStyle: "custom",
        navigationBarBackgroundColor: '#ffffff',
        needLogin: false,  
        disableScroll: true 
      }
    },
    {
      path: 'pages/index/index',
      style: {
		navigationStyle: "custom",
        navigationBarTitleText: '首页',
        needLogin: true,
        enablePullDownRefresh: true
      }
    },
	{
	  path: 'pages/discount/index',
	  style: {
		navigationStyle: "custom",
	    navigationBarTitleText: '优惠券',
	    needLogin: true,
	    enablePullDownRefresh: true
	  }
	},
	{
	  path: 'pages/Order/index',
	  style: {
		navigationStyle: "custom",
	    navigationBarTitleText: '订单中心',
	    needLogin: true,
	    enablePullDownRefresh: true
	  }
	},
	{
	  path: 'pages/DiscountCenter/index',
	  style: {
		navigationStyle: "custom",
	    navigationBarTitleText: '优惠中心',
	    needLogin: true,
	    enablePullDownRefresh: true
	  }
	},
	{
	  path: 'pages/Shopselec/index',
	  style: {
		navigationStyle: "custom",
	    navigationBarTitleText: '店铺选择',
	    needLogin: true,
	    enablePullDownRefresh: true
	  }
	},
	{
	  path: 'pages/Payment/index',
	  style: {
		navigationStyle: "custom",
	    navigationBarTitleText: '支付',
	    needLogin: true,
	    enablePullDownRefresh: true
	  }
	},
    {
      path: 'pages/Recharge/Recharge',
      style: {
        navigationBarTitleText: '充值',
		navigationStyle: "custom",
        needLogin: true,
        transparentTitle: 'always'
      }
    }
  ],
  // 添加全局路由拦截配置
  routeInterceptor: {
    loginPagePath: '/pages/Login/index',
    excludePaths: ['/pages/Login/index']
  }
})